package com.code.springbootrabbitmq.simple;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Date;

/*
 * @author: liyufei
 * @date: 2018-06-01 10:01
 */
@Component
public class MessageProduct {

    @Autowired
    private AmqpTemplate rabbitTemplage;

    public void send() {
        String context = "hello " + new Date();
        System.out.println("Sender : " + context);
        rabbitTemplage.convertAndSend("hello", context);
    }
}
